import axios from 'axios'
import {
  MessageBox,
  Message
} from 'element-ui'
//import store from '@/store'


const service = axios.create({
  baseURL: "http://localhost:8088",
  timeout: 5000
})

// response interceptor  拦截器
service.interceptors.response.use(
  response => {
    const res = response.data
    return res

  },
  error => {
    console.log('err' + error)
    Message({
      message: error.message,
      type: 'error',
      duration: 5 * 1000
    })
    return Promise.reject(error)
  }
)

export default service